package com.neu.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neu.po.ResponseResult;
import com.neu.po.Storey;
import com.neu.service.StoreyService;


@RestController
@RequestMapping("Storey")
public class StoreyController {
	
	@Autowired
	private StoreyService storeyService;
	
	@RequestMapping("getAll")
	public ResponseResult getAll() {
		ResponseResult result = new ResponseResult();
		result.setData(storeyService.getAll());
		return result;
	}
	@RequestMapping("update")
	public ResponseResult update(@RequestBody Storey storey) {
		ResponseResult result = new ResponseResult();
		result.setData(storeyService.update(storey));
		
		return result;
	}
	@RequestMapping("delete")
	public ResponseResult delete(int id) {
		ResponseResult result = new ResponseResult();
		result.setData(storeyService.delete(id));
		
		return result;
	}
	@RequestMapping("insert")
	public ResponseResult insert(@RequestBody Storey storey) {
		ResponseResult result = new ResponseResult();
		//goodsmanage.setDelmark(1);
		result.setData(storeyService.insert(storey));
		
		return result;
	}
	@RequestMapping("batchDelete")
	public ResponseResult batchDelete(@RequestBody List<Integer> ids) {
		ResponseResult result = new ResponseResult();
		result.setData(storeyService.batchDelete(ids));
		
		return result;
	}
	
}
